{% extends "base.html" %}
{% load custom_filters %}

{% block title %}Breeding Cage Detail{% endblock title%}

{% block scripts %}{% include "sortable_table_script.html" %}{% endblock scripts %}

{% block header %}Breeding Cage - {{ breeding.Cage }}{% endblock header %}

{% block content %}
<table>
 <thead>
 <tr>
  <th>Strain</th>
  <th>Cage</th>
  <th>Name</th>
  <th>Start</th>
  <th>Duration</th>
  <th>Crosstype</th>
  <th>Rack</th>
  <th>Position</th>
 </tr>
 </thead>
 <tdata>
 <tr>
 <td><a href="/mousedb{{ breeding.Strain.get_absolute_url }}">{{ breeding.Strain }}</a></td>
 <td>{{ breeding.Cage }}</td>
 <td>{{ breeding.BreedingName }}</td>
 <td>{{ breeding.Start }}</td>
 <td>{{ breeding.Start|timesince }}</td>
 <td>{{ breeding.Crosstype }}</td>
 <td>{{ breeding.Rack }}</td>
 <td>{{ breeding.Rack_Position|all_caps }}</td>
 </tr>
 </tdata>
</table>
<p>To enter information about timed matings click <a href="/mousedb/admin/timed_mating/timedmating/" title="timed matings entry page">here</a>.  For instructions please go <a href="http://code.google.com/p/mousedb/wiki/TimedMatings" title = "Timed matings Wiki page">here</a></p>
<ul>
<li><a href="/mousedb/breeding/{{ breeding.id }}/pups">Add/Wean Pups</a></li>
<li><a href="/mousedb/breeding/{{ breeding.id }}/change">Eartag/Genotype/Cage Changes/Death</a></li>
</ul>
<p>For data entry instructions go to the <a href="http://code.google.com/p/mousedb/wiki/DataEntry">MouseDB Wiki</a></p>
<h2>Pups</h2>
<p>Sort table by clicking headers.  Select multiple headers by holding SHIFT</p>
<table class="sortable">
 <thead>
  <tr>
   <th>Born</th><th>MouseID</th><th>Strain</th><th>Background</th><th>Gender</th><th>Genotype</th><th>Cage</th><th>Rack</th><th>Position</th><th>Markings</th><th>Age/Death</th>
  </tr>
 </thead>
 <tdata>
{% for animal in pups %}
 <tr>
  <td>{{ animal.Born }}</td>
  <td><a href = "/mousedb/mouse/{{ animal.id }}">{{ animal.MouseID}}</a></td>
  <td><a href="/mousedb{{ animal.Strain.get_absolute_url }}">{{ animal.Strain }}</a></td>
  <td>{{ animal.Background }}</td>
  <td>{{ animal.Gender }}</td>
  <td>{{ animal.Genotype }}</td>
  <td>{{ animal.Cage }}</td>
  <td>{{ animal.Rack|all_caps }}</td>
  <td>{{ animal.Rack_Position|all_caps }}</td>
  <td>{{ animal.Markings }}</td>
  {% if animal.Death %}
	<td id="dead">{{ animal.Death }}</td>
  {% else %}
	<td id="age">{{ animal.Born|timesince }}</td>
  {% endif %}
  </tr>
{% endfor%}
 </tdata>
</table>
{% with breeding.plugevents_set.all as plug_list %}
<h2>Plug Events ({{plug_list.count}}) <a href="/mousedb/plug/breeding/{{breeding.id}}/new"><img src="/mousedb-media/admin-media/img/admin/icon_addlink.gif" border="none" alt="add" title="Add Plug Event"></a></h2>
{% if plug_list %}
{% include "plug_table.html" %}
{% endif %}
{% endwith %}
<p>To change this breeding cage click <a href="/mousedb/breeding/{{breeding.id}}/update">here</a>.  To delete (not deactivate but to completely erase all data) this breeding cage click <a href="/mousedb/breeding/{{breeding.id}}/delete">here</a></p>
{% endblock content %}
